package daikoku;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class AnaliseFaixas {

	public static void main(String[] args) {
		BufferedReader br = null;
		try {
			br = new BufferedReader(new FileReader(new File("sena.csv")));

			int f1 = 0;
			int f2 = 0;
			int f3 = 0;
			int f4 = 0;
			int f5 = 0;
			int f6 = 0;

			int count = 0;
			String line = null;
			while ((line = br.readLine()) != null) {
				for (Integer p1 : StringUtils.splitAsIntArray(line)) {
					if (p1 <= 10) {
						++f1;
					} else if (p1 <= 20) {
						++f2;
					} else if (p1 <= 30) {
						++f3;
					} else if (p1 <= 40) {
						++f4;
					} else if (p1 <= 50) {
						++f5;
					} else if (p1 <= 60) {
						++f6;
					}
				}
				count++;
			}

			System.out.println(count);
			System.out.println(f1 + " - " + Float.valueOf(f1) / Float.valueOf(count));
			System.out.println(f2 + " - " + Float.valueOf(f2) / Float.valueOf(count));
			System.out.println(f3 + " - " + Float.valueOf(f3) / Float.valueOf(count));
			System.out.println(f4 + " - " + Float.valueOf(f4) / Float.valueOf(count));
			System.out.println(f5 + " - " + Float.valueOf(f5) / Float.valueOf(count));
			System.out.println(f6 + " - " + Float.valueOf(f6) / Float.valueOf(count));

		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				br.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
